<?php
//命名空间
namespace App\Http\Controllers\Admin;
//引入了request
use Illuminate\Http\Request;
//use App\Http\Controllers\Controller;
class TestController extends Controller{
    //代码空间
    public function input($name) {
        return 'name值为' .$name;
    }

    public function form() {
        return view('form');
    }
    public function transfer() {
        return '转账成功';
    }

    public function profile() {
        return view('profile');
    }
    public function store(Request $request){
        $validatedDate=$request->validate([
            'name'=>'required|string|bail|max:255',
            'email'=>'required|email',
            'age'=>'required|integer',
            'hibody'=>'required',
        ]);
    }

    public function testSession(){
        session(['name'=>'张三','age'=>18]);
        dump(session('name'));
        dump(session('age',0));
        dump(session()->all());
        dump(session()->forget('name'));
        dump(session()->has('name'));
        session()->flush();
        dump(session()->all());
    }
}